<%--
  Created by IntelliJ IDEA.
  User: dailyblue
  Date: 2024/1/22
  Time: 10:56
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" isELIgnored="false" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<h2>分支结构</h2>
<c:set var="i" value="89" scope="page"/>


i:${i}<br/>
i%2:${i%2}<br/>
i%2==0:${i%2==0}
<h3>if结构</h3>
<c:if test="${i%2==0}">
    ${i}是偶数
</c:if>
<h3>if-else结构</h3>
<c:choose>
    <c:when test="${i%2==0}">
        ${i}是偶数
    </c:when>
    <c:otherwise>
        ${i}是奇数
    </c:otherwise>
</c:choose>
<h3>多重if结构</h3>
<c:choose>
    <c:when test="${i==100}">
        满分
    </c:when>
    <c:when test="${i>=85}">
        优秀
    </c:when>
    <c:when test="${i>=60}">
        及格
    </c:when>
    <c:otherwise>
        差
    </c:otherwise>
</c:choose>
</body>
</html>